<template>
  <div class="goods">
    <goods-list-item
      v-for="item in goodsList"
      :key="goodsList.id"
      :list-item="item"
    ></goods-list-item>
  </div>
</template>

<script>
import GoodsListItem from "./GoodsListItem.vue";
export default {
  components: { GoodsListItem },
  name: "GoodsList",
  props: {
    /* 用于接收首页请求到的goods并且传过来的数据 */
    goodsList: {
      type: Array,
      default() {
        return [];
      },
    },
  },
};
</script>

<style>
.goods {
  display: flex;
  flex-flow: wrap;
  /* 用在父容器，改变子项目主轴排列方式 */
  justify-content: space-around;
}
</style>